/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package engine.game.hud;

import engine.game.gfx.ColoredSprite;
import java.awt.Color;
import javax.swing.JLabel;

/**
 *
 * @author NathanT
 */
public class SpriteRenderer extends JLabel {
    
    private ColoredSprite sprite;
    private int scale;
    
    public SpriteRenderer(ColoredSprite sprite, int scale) {
        this.sprite = sprite;
        this.scale = scale;
        this.setIcon(sprite.getImageIcon(scale, this.getBackground()));
    }
    
    public void updateBackground(Color newBack) {
        this.setIcon(sprite.getImageIcon(scale, newBack));
    }
    
    public void setIcon(ColoredSprite sprite, int scale) {
        this.setIcon(sprite.getImageIcon(scale, this.getBackground()));
    }
    
}
